{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "welcome.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "id": "7i1UqqIkNxAt",
        "outputId": "2f9c0fc3-ba1a-499d-f4ea-0bfe160ae841",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 129
        }
      },
      "source": [
        "# Import tensorflow\n",
        "import tensorflow as tf\n",
        "\n",
        "# Check version\n",
        "print(\"Tensorflow version: \", tf.__version__)\n",
        "\n",
        "# Test TensorFlow for cuda availibility\n",
        "print(\"Tensorflow is built with CUDA: \", tf.test.is_built_with_cuda())\n",
        "\n",
        "# Check devices\n",
        "print(\"All devices: \", tf.config.list_physical_devices(device_type=None))\n",
        "print(\"GPU devices: \", tf.config.list_physical_devices(device_type='GPU'))\n",
        "\n",
        "# Print a randomly generated tensor\n",
        "# tf.math.reduce_sum: https://www.tensorflow.org/api_docs/python/tf/math/reduce_sum\n",
        "# tf.random.normal: https://www.tensorflow.org/api_docs/python/tf/random/normal\n",
        "print(tf.math.reduce_sum(tf.random.normal([1, 10])))\n"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Tensorflow version:  2.3.0\n",
            "Tensorflow is built with CUDA:  True\n",
            "All devices:  [PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/physical_device:XLA_CPU:0', device_type='XLA_CPU'), PhysicalDevice(name='/physical_device:XLA_GPU:0', device_type='XLA_GPU'), PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]\n",
            "GPU devices:  [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]\n",
            "tf.Tensor(-4.315793, shape=(), dtype=float32)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "rcU8_F3fPUb5"
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}